﻿<html lang="zh_CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script type="text/javascript" src="jquery.js">
</script>
        <title>
            点击下载Ehrome应用
        </title>
        <style type="text/css">
*{margin:0; padding:0;}
        a{text-decoration: none;}
        img{max-width: 100%; height: auto;}
        .weixin-tip{display: none; position: fixed; left:0; top:0; bottom:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80);  height: 100%; width: 100%; z-index: 100;}
        .weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}
        </style>
    </head>
    <body>
        <div class="weixin-tip">
            <p>
                <img src="https://gitee.com/apple314507871/tupianku/raw/master/live_weixin.png" alt="微信打开">
            </p>
        </div><script type="text/javascript">
/**
        * [通过参数名获取url中的参数值]
        * 示例URL:http://htmlJsTest/getrequest.html?uid=admin&rid=1&fid=2&name=小明
        * @param  {[string]} queryName [参数名]
        * @return {[string]}           [参数值]
        */
        function GetQueryValue(queryName) {
        var reg = new RegExp("(^|&)"+ queryName +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
        }
        var id = GetQueryValue("id");
        function callback(result){
    
               window.location.href = result;
        }

        function httpGetAsync(theUrl, callback)
        {
        var xmlHttp = new XMLHttpRequest();
        xmlHttp.onreadystatechange = function() { 
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
            callback(xmlHttp.responseText);
        }
        xmlHttp.open("GET", theUrl, true); // true for asynchronous 
        xmlHttp.send(null);
        }

        $(window).on("load",function(){
            var winHeight = $(window).height();
            function is_weixin() {
                var ua = navigator.userAgent.toLowerCase();
                if (ua.match(/MicroMessenger/i) == "micromessenger") {
                    return true;
                } else {
                    return false;
                }
            }
            var isWeixin = is_weixin();
            if(isWeixin){
                $(".weixin-tip").css("height",winHeight);
                $(".weixin-tip").show();
            }else{
    
        //http://www.ehrome.cn/m/download.php?id=314507871
        var url = "http://www.ehrome.cn/m/download.php?id="+id;
        httpGetAsync(url,callback);
        }
        })
        </script>
    </body>
</html>